SftTree/NET 2.0

Copy Method, ItemClass Class

Softel vdm, Inc.

Copies an item to a new position in the tree control.

Syntax      ItemClass Class (Softelvdm.SftTreeNET)

VB   

Public Function Copy( _
     ByVal ItemCollection As ItemCollectionClass, _
     ByVal fDeep As Boolean _
  ) As ItemClass
Public Function Copy( _
     ByVal ItemTarget As ItemClass, _
     ByVal Style As CopyStyleEnum, _
     ByVal fDeep As Boolean _
  ) As ItemClass

C#   

public ItemClass Copy(
     ItemCollectionClass ItemCollection,
     bool fDeep );
public ItemClass Copy(
     ItemClass ItemTarget,
     CopyStyleEnum Style,
     bool fDeep );

C++   

public: ItemClass^ Copy(
     ItemCollectionClass^ ItemCollection,
     bool fDeep );
public: ItemClass^ Copy(
     ItemClass^ ItemTarget,
     CopyStyleEnum Style,
     bool fDeep );

fDeep

Defines whether child items are also copied. True to copy all child items, otherwise False.

ItemCollection

The item collection.

ItemTarget

Specifies the target item, where the new item is to be copied to.

Style

Defines how the item is copied.

CopyStyleEnum

Value

Description

BeforeTargetAsSibling

0

The new item is inserted before the target item as the target item's sibling.

AfterTargetAsSibling

1

The new item is inserted after the target item as the target item's sibling.

TargetAsParentInsertFirst

2

The new item is added as the target item's first child item.

TargetAsParentAdd

3

The new item is added as the target item's last child item.

Return Value

The new item.

Comments

The Copy method copies an item to a new position in the tree control.

The Copy method accepting an ItemCollection argument is usually used when copying items into an empty tree control. The tree control's empty item collection is represented by the ItemCollection property.

Items that are copied lose their selection status and are no longer selected.


Feedback / comments / error reports for this topic
© 2007 - Softel vdm, Inc. - www.softelvdm.com